package com.fengchao.api.config;


import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service
@Scope("singleton")
public class WeChatConfig {

    //开放平台的
    public static String LOGIN_APPID = "wx75fcedcecac9784e";// 微信APPid
    public static String LOGIN_APP_SECRET = "bc40917331080868c499fde3fc302179";// 微信appsecret

    //公众平台的
    public static String APPID = "wxbf3199d41f5ce12c";// 微信APPid
    public static String APP_SECRET = "ee1d389d5ba5b69c52fb2e025d1ffeb3";// 微信appsecret

    //
    public static String encodingAesKey;// 微信EncodingAESKey
    public static String local;// 回调url
    // 微信常用状态
    public static String WECHAT_UNBIND = "unbind";// 未绑定
    public static String WECHAT_BINDED = "binded";// 已绑定
    public static String WECHAT_USING = "using";// 正在使用
    public static String WECHAT_UNUSING = "unusing";// 未使用
    public static String WECHAT_FOCUS = "focus";// 关注
    public static String WECHAT_CANCEL = "cancel";// 取消关注
    // 微信请求返回码
    public static int SUCCESS = 0;// 成功
    public static int FAILURE = -1;// 失败
    // BIZ访问地址
    public static String BIZ_HOST = "http://www.laolaibao.com";

    // 获取微信accessToken的url get方法
    // 参数 grant_type=client_credential&appid=APPID&secret=APPSECRET
    public static String WECHAT_URL_ACCESSTOKEN = "https://api.weixin.qq.com/cgi-bin/token";

    // 刷新微信accessToken的url get方法
    public static String WECHAT_URL_REFRESHTOKEN = "https://api.weixin.qq.com/sns/oauth2/refresh_token";

    // 获取微信js sdk ticket get
    // ?access_token=ACCESS_TOKEN&type=jsapi
    public static String WECHAT_URL_JSAPI_TICKET = "https://api.weixin.qq.com/cgi-bin/ticket/getticket";
    // 自定义菜单的接口 post方法
    // 参数?access_token=ACCESS_TOKEN
    public static String WECHAT_URL_CREATMENU = "https://api.weixin.qq.com/cgi-bin/menu/create";
    //查询菜单接口
    public static String WECHAT_URL_GETMENU = "https://api.weixin.qq.com/cgi-bin/menu/get";

    // 网页授权获取用户信息 get方法
    // 参数
    // ?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
    public static String WECHAT_URL_AUTHORIZE = "https://open.weixin.qq.com/connect/oauth2/authorize";
    // 网页获取授权的用户信息
    public static String WECHAT_URL_USERINFO = "https://api.weixin.qq.com/sns/userinfo";
    // 网页根据code获取授权oppenID和access_token
    public static String WECHAT_URL_AUTH_TOKEN = "https://api.weixin.qq.com/sns/oauth2/access_token";
    // 网页获取用户信息的授权地址
    public static String WECHAT_URL_REDIRECT_ACCESS = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&response_type=code&scope={2}&state=STATE#wechat_redirect";
    // 通过UnionID机制获取用户信息
    public static String WECHAT_URL_UNIONID_USERINFO = "https://api.weixin.qq.com/cgi-bin/user/info";

    // 自定义点击事件的KEY
    public static String CLICK_KEY_PENSION = "pension";// 我的养老金事件
    public static String CLICK_KEY_PENSION_SERVICE = "pensionService";// 我的养老金事件
    public static String CLICK_KEY_REDPACK = "wechatRedPack";// 微信红包
    public static String CLICK_KEY_ZANRENPIN = "zanrenpin";// 攒人品的key
    public static String ClICK_KEY_FOCUSREDPACK = "wechatFocusRedPack";// 关注送红包
    // 加密类型
    public static String ENCRYPT_TYPE_RAW = "raw";// 不加密
    public static String ENCRYPT_TYPE_AES = "aes";// AES加密

    /**
     * 返回消息类型：文本
     */
    public static final String RESP_MESSAGE_TYPE_TEXT = "text";

    /**
     * 返回消息类型：音乐
     */
    public static final String RESP_MESSAGE_TYPE_MUSIC = "music";

    /**
     * 返回消息类型：图文
     */
    public static final String RESP_MESSAGE_TYPE_NEWS = "news";

    /**
     * 请求消息类型：文本
     */
    public static final String REQ_MESSAGE_TYPE_TEXT = "text";

    /**
     * 请求消息类型：图片
     */
    public static final String REQ_MESSAGE_TYPE_IMAGE = "image";

    /**
     * 请求消息类型：链接
     */
    public static final String REQ_MESSAGE_TYPE_LINK = "link";

    /**
     * 请求消息类型：地理位置
     */
    public static final String REQ_MESSAGE_TYPE_LOCATION = "location";

    /**
     * 请求消息类型：音频
     */
    public static final String REQ_MESSAGE_TYPE_VOICE = "voice";

    /**
     * 请求消息类型：推送
     */
    public static final String REQ_MESSAGE_TYPE_EVENT = "event";

    /**
     * 事件类型：subscribe(订阅)
     */
    public static final String EVENT_TYPE_SUBSCRIBE = "subscribe";

    /**
     * 事件类型：unsubscribe(取消订阅)
     */
    public static final String EVENT_TYPE_UNSUBSCRIBE = "unsubscribe";

    /**
     * 事件类型：CLICK(自定义菜单点击事件)
     */
    public static final String EVENT_TYPE_CLICK = "CLICK";

    /**
     * 事件类型：CLICK(自定义菜单点击事件)
     */
    public static final String EVENT_TYPE_VIEW = "VIEW";


}